namespace ArmyManager.Commands
{
	public abstract class BasicCommand : ICommand
	{
		public bool Executed { get; private set; }

		public void Execute()
		{
			if (!Executed)
			{
				ExecuteInternal();
				Executed = true;
			}
		}

		protected abstract void ExecuteInternal();

		public void Undo()
		{
			if (Executed)
			{
				UndoInternal();
				Executed = false;
			}
		}

		protected abstract void UndoInternal();
	}
}